using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

/// <summary>
/// Summary description for Functions
/// </summary>
public class Functions
{
	public Functions()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static void ReadFile(string file_path, ref String counter)
    {
        StreamReader objStreamReader = File.OpenText(file_path);
        String tmp_str = objStreamReader.ReadToEnd();
        int tmp = Convert.ToInt32(tmp_str.ToString()) + 1;
        counter = tmp.ToString();
        objStreamReader.Close();
    }

    public static String ReadFile(string file_path)
    {
        StreamReader objStreamReader = File.OpenText(file_path);
        String tmp_str = objStreamReader.ReadToEnd();
        objStreamReader.Close();
        return tmp_str;
    }

    public static void WriteFile(string file_path, String content)
    {
        StreamWriter objFileWriter = File.CreateText(file_path);
        objFileWriter.Write(content);
        objFileWriter.Close();
    }

    public static void message_box(Page page, string messgage)
    {
        page.ClientScript.RegisterStartupScript(page.GetType(), "Message", "<script language='javascript'>alert('" + messgage + "');</script>");
    }
}
